

<!DOCTYPE html>

<html>
  <head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>llvm-cov - emit coverage information &#8212; LLVM 9 documentation</title>
    <link rel="stylesheet" href="../_static/llvm-theme.css" type="text/css" />
    <link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
    <script id="documentation_options" data-url_root="../" src="../_static/documentation_options.js"></script>
    <script src="../_static/jquery.js"></script>
    <script src="../_static/underscore.js"></script>
    <script src="../_static/doctools.js"></script>
    <script src="../_static/language_data.js"></script>
    <link rel="index" title="Index" href="../genindex.html" />
    <link rel="search" title="Search" href="../search.html" />
    <link rel="next" title="llvm-profdata - Profile data tool" href="llvm-profdata.html" />
    <link rel="prev" title="llvm-diff - LLVM structural ‘diff’" href="llvm-diff.html" />
<style type="text/css">
  table.right { float: right; margin-left: 20px; }
  table.right td { border: 1px solid #ccc; }
</style>

  </head><body>
<div class="logo">
  <a href="../index.html">
    <img src="../_static/logo.png"
         alt="LLVM Logo" width="250" height="88"/></a>
</div>

    <div class="related" role="navigation" aria-label="related navigation">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="../genindex.html" title="General Index"
             accesskey="I">index</a></li>
        <li class="right" >
          <a href="llvm-profdata.html" title="llvm-profdata - Profile data tool"
             accesskey="N">next</a> |</li>
        <li class="right" >
          <a href="llvm-diff.html" title="llvm-diff - LLVM structural ‘diff’"
             accesskey="P">previous</a> |</li>
  <li><a href="http://llvm.org/">LLVM Home</a>&nbsp;|&nbsp;</li>
  <li><a href="../index.html">Documentation</a>&raquo;</li>

          <li class="nav-item nav-item-1"><a href="index.html" accesskey="U">LLVM Command Guide</a> &#187;</li>
        <li class="nav-item nav-item-this"><a href="">llvm-cov - emit coverage information</a></li> 
      </ul>
    </div>


    <div class="document">
      <div class="documentwrapper">
          <div class="body" role="main">
            
  <div class="section" id="llvm-cov-emit-coverage-information">
<h1>llvm-cov - emit coverage information<a class="headerlink" href="#llvm-cov-emit-coverage-information" title="Permalink to this headline">¶</a></h1>
<div class="section" id="synopsis">
<h2>SYNOPSIS<a class="headerlink" href="#synopsis" title="Permalink to this headline">¶</a></h2>
<p><strong class="program">llvm-cov</strong> <em>command</em> [<em>args…</em>]</p>
</div>
<div class="section" id="description">
<h2>DESCRIPTION<a class="headerlink" href="#description" title="Permalink to this headline">¶</a></h2>
<p>The <strong class="program">llvm-cov</strong> tool shows code coverage information for
programs that are instrumented to emit profile data. It can be used to
work with <code class="docutils literal notranslate"><span class="pre">gcov</span></code>-style coverage or with <code class="docutils literal notranslate"><span class="pre">clang</span></code>'s instrumentation
based profiling.</p>
<p>If the program is invoked with a base name of <code class="docutils literal notranslate"><span class="pre">gcov</span></code>, it will behave as if
the <strong class="program">llvm-cov gcov</strong> command were called. Otherwise, a command should
be provided.</p>
</div>
<div class="section" id="commands">
<h2>COMMANDS<a class="headerlink" href="#commands" title="Permalink to this headline">¶</a></h2>
<ul class="simple">
<li><p><a class="reference internal" href="#llvm-cov-gcov"><span class="std std-ref">gcov</span></a></p></li>
<li><p><a class="reference internal" href="#llvm-cov-show"><span class="std std-ref">show</span></a></p></li>
<li><p><a class="reference internal" href="#llvm-cov-report"><span class="std std-ref">report</span></a></p></li>
<li><p><a class="reference internal" href="#llvm-cov-export"><span class="std std-ref">export</span></a></p></li>
</ul>
</div>
<div class="section" id="gcov-command">
<span id="llvm-cov-gcov"></span><h2>GCOV COMMAND<a class="headerlink" href="#gcov-command" title="Permalink to this headline">¶</a></h2>
<div class="section" id="id1">
<h3>SYNOPSIS<a class="headerlink" href="#id1" title="Permalink to this headline">¶</a></h3>
<p><strong class="program">llvm-cov gcov</strong> [<em>options</em>] <em>SOURCEFILE</em></p>
</div>
<div class="section" id="id2">
<h3>DESCRIPTION<a class="headerlink" href="#id2" title="Permalink to this headline">¶</a></h3>
<p>The <strong class="program">llvm-cov gcov</strong> tool reads code coverage data files and displays
the coverage information for a specified source file. It is compatible with the
<code class="docutils literal notranslate"><span class="pre">gcov</span></code> tool from version 4.2 of <code class="docutils literal notranslate"><span class="pre">GCC</span></code> and may also be compatible with some
later versions of <code class="docutils literal notranslate"><span class="pre">gcov</span></code>.</p>
<p>To use <strong class="program">llvm-cov gcov</strong>, you must first build an instrumented version
of your application that collects coverage data as it runs. Compile with the
<code class="docutils literal notranslate"><span class="pre">-fprofile-arcs</span></code> and <code class="docutils literal notranslate"><span class="pre">-ftest-coverage</span></code> options to add the
instrumentation. (Alternatively, you can use the <code class="docutils literal notranslate"><span class="pre">--coverage</span></code> option, which
includes both of those other options.) You should compile with debugging
information (<code class="docutils literal notranslate"><span class="pre">-g</span></code>) and without optimization (<code class="docutils literal notranslate"><span class="pre">-O0</span></code>); otherwise, the
coverage data cannot be accurately mapped back to the source code.</p>
<p>At the time you compile the instrumented code, a <code class="docutils literal notranslate"><span class="pre">.gcno</span></code> data file will be
generated for each object file. These <code class="docutils literal notranslate"><span class="pre">.gcno</span></code> files contain half of the
coverage data. The other half of the data comes from <code class="docutils literal notranslate"><span class="pre">.gcda</span></code> files that are
generated when you run the instrumented program, with a separate <code class="docutils literal notranslate"><span class="pre">.gcda</span></code>
file for each object file. Each time you run the program, the execution counts
are summed into any existing <code class="docutils literal notranslate"><span class="pre">.gcda</span></code> files, so be sure to remove any old
files if you do not want their contents to be included.</p>
<p>By default, the <code class="docutils literal notranslate"><span class="pre">.gcda</span></code> files are written into the same directory as the
object files, but you can override that by setting the <code class="docutils literal notranslate"><span class="pre">GCOV_PREFIX</span></code> and
<code class="docutils literal notranslate"><span class="pre">GCOV_PREFIX_STRIP</span></code> environment variables. The <code class="docutils literal notranslate"><span class="pre">GCOV_PREFIX_STRIP</span></code>
variable specifies a number of directory components to be removed from the
start of the absolute path to the object file directory. After stripping those
directories, the prefix from the <code class="docutils literal notranslate"><span class="pre">GCOV_PREFIX</span></code> variable is added. These
environment variables allow you to run the instrumented program on a machine
where the original object file directories are not accessible, but you will
then need to copy the <code class="docutils literal notranslate"><span class="pre">.gcda</span></code> files back to the object file directories
where <strong class="program">llvm-cov gcov</strong> expects to find them.</p>
<p>Once you have generated the coverage data files, run <strong class="program">llvm-cov gcov</strong>
for each main source file where you want to examine the coverage results. This
should be run from the same directory where you previously ran the
compiler. The results for the specified source file are written to a file named
by appending a <code class="docutils literal notranslate"><span class="pre">.gcov</span></code> suffix. A separate output file is also created for
each file included by the main source file, also with a <code class="docutils literal notranslate"><span class="pre">.gcov</span></code> suffix added.</p>
<p>The basic content of an <code class="docutils literal notranslate"><span class="pre">.gcov</span></code> output file is a copy of the source file with
an execution count and line number prepended to every line. The execution
count is shown as <code class="docutils literal notranslate"><span class="pre">-</span></code> if a line does not contain any executable code. If
a line contains code but that code was never executed, the count is displayed
as <code class="docutils literal notranslate"><span class="pre">#####</span></code>.</p>
</div>
<div class="section" id="options">
<h3>OPTIONS<a class="headerlink" href="#options" title="Permalink to this headline">¶</a></h3>
<dl class="std option">
<dt id="cmdoption-llvm-cov-gcov-a">
<span id="cmdoption-llvm-cov-gcov-all-blocks"></span><code class="sig-name descname">-a</code><code class="sig-prename descclassname"></code><code class="sig-prename descclassname">, </code><code class="sig-name descname">--all-blocks</code><code class="sig-prename descclassname"></code><a class="headerlink" href="#cmdoption-llvm-cov-gcov-a" title="Permalink to this definition">¶</a></dt>
<dd><p>Display all basic blocks. If there are multiple blocks for a single line of
source code, this option causes llvm-cov to show the count for each block
instead of just one count for the entire line.</p>
</dd></dl>

<dl class="std option">
<dt id="cmdoption-llvm-cov-gcov-b">
<span id="cmdoption-llvm-cov-gcov-branch-probabilities"></span><code class="sig-name descname">-b</code><code class="sig-prename descclassname"></code><code class="sig-prename descclassname">, </code><code class="sig-name descname">--branch-probabilities</code><code class="sig-prename descclassname"></code><a class="headerlink" href="#cmdoption-llvm-cov-gcov-b" title="Permalink to this definition">¶</a></dt>
<dd><p>Display conditional branch probabilities and a summary of branch information.</p>
</dd></dl>

<dl class="std option">
<dt id="cmdoption-llvm-cov-gcov-c">
<span id="cmdoption-llvm-cov-gcov-branch-counts"></span><code class="sig-name descname">-c</code><code class="sig-prename descclassname"></code><code class="sig-prename descclassname">, </code><code class="sig-name descname">--branch-counts</code><code class="sig-prename descclassname"></code><a class="headerlink" href="#cmdoption-llvm-cov-gcov-c" title="Permalink to this definition">¶</a></dt>
<dd><p>Display branch counts instead of probabilities (requires -b).</p>
</dd></dl>

<dl class="std option">
<dt id="cmdoption-llvm-cov-gcov-f">
<span id="cmdoption-llvm-cov-gcov-function-summaries"></span><code class="sig-name descname">-f</code><code class="sig-prename descclassname"></code><code class="sig-prename descclassname">, </code><code class="sig-name descname">--function-summaries</code><code class="sig-prename descclassname"></code><a class="headerlink" href="#cmdoption-llvm-cov-gcov-f" title="Permalink to this definition">¶</a></dt>
<dd><p>Show a summary of coverage for each function instead of just one summary for
an entire source file.</p>
</dd></dl>

<dl class="std option">
<dt id="cmdoption-llvm-cov-gcov-help">
<code class="sig-name descname">--help</code><code class="sig-prename descclassname"></code><a class="headerlink" href="#cmdoption-llvm-cov-gcov-help" title="Permalink to this definition">¶</a></dt>
<dd><p>Display available options (–help-hidden for more).</p>
</dd></dl>

<dl class="std option">
<dt id="cmdoption-llvm-cov-gcov-l">
<span id="cmdoption-llvm-cov-gcov-long-file-names"></span><code class="sig-name descname">-l</code><code class="sig-prename descclassname"></code><code class="sig-prename descclassname">, </code><code class="sig-name descname">--long-file-names</code><code class="sig-prename descclassname"></code><a class="headerlink" href="#cmdoption-llvm-cov-gcov-l" title="Permalink to this definition">¶</a></dt>
<dd><p>For coverage output of files included from the main source file, add the
main file name followed by <code class="docutils literal notranslate"><span class="pre">##</span></code> as a prefix to the output file names. This
can be combined with the –preserve-paths option to use complete paths for
both the main file and the included file.</p>
</dd></dl>

<dl class="std option">
<dt id="cmdoption-llvm-cov-gcov-n">
<span id="cmdoption-llvm-cov-gcov-no-output"></span><code class="sig-name descname">-n</code><code class="sig-prename descclassname"></code><code class="sig-prename descclassname">, </code><code class="sig-name descname">--no-output</code><code class="sig-prename descclassname"></code><a class="headerlink" href="#cmdoption-llvm-cov-gcov-n" title="Permalink to this definition">¶</a></dt>
<dd><p>Do not output any <code class="docutils literal notranslate"><span class="pre">.gcov</span></code> files. Summary information is still
displayed.</p>
</dd></dl>

<dl class="std option">
<dt id="cmdoption-llvm-cov-gcov-o">
<span id="cmdoption-llvm-cov-gcov-object-directory"></span><span id="cmdoption-llvm-cov-gcov-object-file"></span><code class="sig-name descname">-o</code><code class="sig-prename descclassname">=&lt;DIR|FILE&gt;</code><code class="sig-prename descclassname">, </code><code class="sig-name descname">--object-directory</code><code class="sig-prename descclassname">=&lt;DIR&gt;</code><code class="sig-prename descclassname">, </code><code class="sig-name descname">--object-file</code><code class="sig-prename descclassname">=&lt;FILE&gt;</code><a class="headerlink" href="#cmdoption-llvm-cov-gcov-o" title="Permalink to this definition">¶</a></dt>
<dd><p>Find objects in DIR or based on FILE’s path. If you specify a particular
object file, the coverage data files are expected to have the same base name
with <code class="docutils literal notranslate"><span class="pre">.gcno</span></code> and <code class="docutils literal notranslate"><span class="pre">.gcda</span></code> extensions. If you specify a directory, the
files are expected in that directory with the same base name as the source
file.</p>
</dd></dl>

<dl class="std option">
<dt id="cmdoption-llvm-cov-gcov-p">
<span id="cmdoption-llvm-cov-gcov-preserve-paths"></span><code class="sig-name descname">-p</code><code class="sig-prename descclassname"></code><code class="sig-prename descclassname">, </code><code class="sig-name descname">--preserve-paths</code><code class="sig-prename descclassname"></code><a class="headerlink" href="#cmdoption-llvm-cov-gcov-p" title="Permalink to this definition">¶</a></dt>
<dd><p>Preserve path components when naming the coverage output files. In addition
to the source file name, include the directories from the path to that
file. The directories are separate by <code class="docutils literal notranslate"><span class="pre">#</span></code> characters, with <code class="docutils literal notranslate"><span class="pre">.</span></code> directories
removed and <code class="docutils literal notranslate"><span class="pre">..</span></code> directories replaced by <code class="docutils literal notranslate"><span class="pre">^</span></code> characters. When used with
the –long-file-names option, this applies to both the main file name and the
included file name.</p>
</dd></dl>

<dl class="std option">
<dt id="cmdoption-llvm-cov-gcov-u">
<span id="cmdoption-llvm-cov-gcov-unconditional-branches"></span><code class="sig-name descname">-u</code><code class="sig-prename descclassname"></code><code class="sig-prename descclassname">, </code><code class="sig-name descname">--unconditional-branches</code><code class="sig-prename descclassname"></code><a class="headerlink" href="#cmdoption-llvm-cov-gcov-u" title="Permalink to this definition">¶</a></dt>
<dd><p>Include unconditional branches in the output for the –branch-probabilities
option.</p>
</dd></dl>

<dl class="std option">
<dt id="cmdoption-llvm-cov-gcov-version">
<code class="sig-name descname">-version</code><code class="sig-prename descclassname"></code><a class="headerlink" href="#cmdoption-llvm-cov-gcov-version" title="Permalink to this definition">¶</a></dt>
<dd><p>Display the version of llvm-cov.</p>
</dd></dl>

<dl class="std option">
<dt id="cmdoption-llvm-cov-gcov-x">
<span id="cmdoption-llvm-cov-gcov-hash-filenames"></span><code class="sig-name descname">-x</code><code class="sig-prename descclassname"></code><code class="sig-prename descclassname">, </code><code class="sig-name descname">--hash-filenames</code><code class="sig-prename descclassname"></code><a class="headerlink" href="#cmdoption-llvm-cov-gcov-x" title="Permalink to this definition">¶</a></dt>
<dd><p>Use md5 hash of file name when naming the coverage output files. The source
file name will be suffixed by <code class="docutils literal notranslate"><span class="pre">##</span></code> followed by MD5 hash calculated for it.</p>
</dd></dl>

</div>
<div class="section" id="exit-status">
<h3>EXIT STATUS<a class="headerlink" href="#exit-status" title="Permalink to this headline">¶</a></h3>
<p><strong class="program">llvm-cov gcov</strong> returns 1 if it cannot read input files.  Otherwise,
it exits with zero.</p>
</div>
</div>
<div class="section" id="show-command">
<span id="llvm-cov-show"></span><h2>SHOW COMMAND<a class="headerlink" href="#show-command" title="Permalink to this headline">¶</a></h2>
<div class="section" id="id3">
<h3>SYNOPSIS<a class="headerlink" href="#id3" title="Permalink to this headline">¶</a></h3>
<p><strong class="program">llvm-cov show</strong> [<em>options</em>] -instr-profile <em>PROFILE</em> <em>BIN</em> [<em>-object BIN,…</em>] [[<em>-object BIN</em>]] [<em>SOURCES</em>]</p>
</div>
<div class="section" id="id4">
<h3>DESCRIPTION<a class="headerlink" href="#id4" title="Permalink to this headline">¶</a></h3>
<p>The <strong class="program">llvm-cov show</strong> command shows line by line coverage of the
binaries <em>BIN</em>,…  using the profile data <em>PROFILE</em>. It can optionally be
filtered to only show the coverage for the files listed in <em>SOURCES</em>.</p>
<p><em>BIN</em> may be an executable, object file, dynamic library, or archive (thin or
otherwise).</p>
<p>To use <strong class="program">llvm-cov show</strong>, you need a program that is compiled with
instrumentation to emit profile and coverage data. To build such a program with
<code class="docutils literal notranslate"><span class="pre">clang</span></code> use the <code class="docutils literal notranslate"><span class="pre">-fprofile-instr-generate</span></code> and <code class="docutils literal notranslate"><span class="pre">-fcoverage-mapping</span></code>
flags. If linking with the <code class="docutils literal notranslate"><span class="pre">clang</span></code> driver, pass <code class="docutils literal notranslate"><span class="pre">-fprofile-instr-generate</span></code>
to the link stage to make sure the necessary runtime libraries are linked in.</p>
<p>The coverage information is stored in the built executable or library itself,
and this is what you should pass to <strong class="program">llvm-cov show</strong> as a <em>BIN</em>
argument. The profile data is generated by running this instrumented program
normally. When the program exits it will write out a raw profile file,
typically called <code class="docutils literal notranslate"><span class="pre">default.profraw</span></code>, which can be converted to a format that
is suitable for the <em>PROFILE</em> argument using the <strong class="program">llvm-profdata merge</strong>
tool.</p>
</div>
<div class="section" id="id5">
<h3>OPTIONS<a class="headerlink" href="#id5" title="Permalink to this headline">¶</a></h3>
<dl class="std option">
<dt id="cmdoption-llvm-cov-show-show-line-counts">
<code class="sig-name descname">-show-line-counts</code><code class="sig-prename descclassname"></code><a class="headerlink" href="#cmdoption-llvm-cov-show-show-line-counts" title="Permalink to this definition">¶</a></dt>
<dd><p>Show the execution counts for each line. Defaults to true, unless another
<code class="docutils literal notranslate"><span class="pre">-show</span></code> option is used.</p>
</dd></dl>

<dl class="std option">
<dt id="cmdoption-llvm-cov-show-show-expansions">
<code class="sig-name descname">-show-expansions</code><code class="sig-prename descclassname"></code><a class="headerlink" href="#cmdoption-llvm-cov-show-show-expansions" title="Permalink to this definition">¶</a></dt>
<dd><p>Expand inclusions, such as preprocessor macros or textual inclusions, inline
in the display of the source file. Defaults to false.</p>
</dd></dl>

<dl class="std option">
<dt id="cmdoption-llvm-cov-show-show-instantiations">
<code class="sig-name descname">-show-instantiations</code><code class="sig-prename descclassname"></code><a class="headerlink" href="#cmdoption-llvm-cov-show-show-instantiations" title="Permalink to this definition">¶</a></dt>
<dd><p>For source regions that are instantiated multiple times, such as templates in
<code class="docutils literal notranslate"><span class="pre">C++</span></code>, show each instantiation separately as well as the combined summary.
Defaults to true.</p>
</dd></dl>

<dl class="std option">
<dt id="cmdoption-llvm-cov-show-show-regions">
<code class="sig-name descname">-show-regions</code><code class="sig-prename descclassname"></code><a class="headerlink" href="#cmdoption-llvm-cov-show-show-regions" title="Permalink to this definition">¶</a></dt>
<dd><p>Show the execution counts for each region by displaying a caret that points to
the character where the region starts. Defaults to false.</p>
</dd></dl>

<dl class="std option">
<dt id="cmdoption-llvm-cov-show-show-line-counts-or-regions">
<code class="sig-name descname">-show-line-counts-or-regions</code><code class="sig-prename descclassname"></code><a class="headerlink" href="#cmdoption-llvm-cov-show-show-line-counts-or-regions" title="Permalink to this definition">¶</a></dt>
<dd><p>Show the execution counts for each line if there is only one region on the
line, but show the individual regions if there are multiple on the line.
Defaults to false.</p>
</dd></dl>

<dl class="std option">
<dt id="cmdoption-llvm-cov-show-use-color">
<code class="sig-name descname">-use-color</code><code class="sig-prename descclassname"></code><a class="headerlink" href="#cmdoption-llvm-cov-show-use-color" title="Permalink to this definition">¶</a></dt>
<dd><p>Enable or disable color output. By default this is autodetected.</p>
</dd></dl>

<dl class="std option">
<dt id="cmdoption-llvm-cov-show-arch">
<code class="sig-name descname">-arch</code><code class="sig-prename descclassname">=[*NAMES*]</code><a class="headerlink" href="#cmdoption-llvm-cov-show-arch" title="Permalink to this definition">¶</a></dt>
<dd><p>Specify a list of architectures such that the Nth entry in the list
corresponds to the Nth specified binary. If the covered object is a universal
binary, this specifies the architecture to use. It is an error to specify an
architecture that is not included in the universal binary or to use an
architecture that does not match a non-universal binary.</p>
</dd></dl>

<dl class="std option">
<dt id="cmdoption-llvm-cov-show-name">
<code class="sig-name descname">-name</code><code class="sig-prename descclassname">=&lt;NAME&gt;</code><a class="headerlink" href="#cmdoption-llvm-cov-show-name" title="Permalink to this definition">¶</a></dt>
<dd><p>Show code coverage only for functions with the given name.</p>
</dd></dl>

<dl class="std option">
<dt id="cmdoption-llvm-cov-show-name-whitelist">
<code class="sig-name descname">-name-whitelist</code><code class="sig-prename descclassname">=&lt;FILE&gt;</code><a class="headerlink" href="#cmdoption-llvm-cov-show-name-whitelist" title="Permalink to this definition">¶</a></dt>
<dd><p>Show code coverage only for functions listed in the given file. Each line in
the file should start with <cite>whitelist_fun:</cite>, immediately followed by the name
of the function to accept. This name can be a wildcard expression.</p>
</dd></dl>

<dl class="std option">
<dt id="cmdoption-llvm-cov-show-name-regex">
<code class="sig-name descname">-name-regex</code><code class="sig-prename descclassname">=&lt;PATTERN&gt;</code><a class="headerlink" href="#cmdoption-llvm-cov-show-name-regex" title="Permalink to this definition">¶</a></dt>
<dd><p>Show code coverage only for functions that match the given regular expression.</p>
</dd></dl>

<dl class="std option">
<dt id="cmdoption-llvm-cov-show-ignore-filename-regex">
<code class="sig-name descname">-ignore-filename-regex</code><code class="sig-prename descclassname">=&lt;PATTERN&gt;</code><a class="headerlink" href="#cmdoption-llvm-cov-show-ignore-filename-regex" title="Permalink to this definition">¶</a></dt>
<dd><p>Skip source code files with file paths that match the given regular expression.</p>
</dd></dl>

<dl class="std option">
<dt id="cmdoption-llvm-cov-show-format">
<code class="sig-name descname">-format</code><code class="sig-prename descclassname">=&lt;FORMAT&gt;</code><a class="headerlink" href="#cmdoption-llvm-cov-show-format" title="Permalink to this definition">¶</a></dt>
<dd><p>Use the specified output format. The supported formats are: “text”, “html”.</p>
</dd></dl>

<dl class="std option">
<dt id="cmdoption-llvm-cov-show-tab-size">
<code class="sig-name descname">-tab-size</code><code class="sig-prename descclassname">=&lt;TABSIZE&gt;</code><a class="headerlink" href="#cmdoption-llvm-cov-show-tab-size" title="Permalink to this definition">¶</a></dt>
<dd><p>Replace tabs with &lt;TABSIZE&gt; spaces when preparing reports. Currently, this is
only supported for the html format.</p>
</dd></dl>

<dl class="std option">
<dt id="cmdoption-llvm-cov-show-output-dir">
<code class="sig-name descname">-output-dir</code><code class="sig-prename descclassname">=PATH</code><a class="headerlink" href="#cmdoption-llvm-cov-show-output-dir" title="Permalink to this definition">¶</a></dt>
<dd><p>Specify a directory to write coverage reports into. If the directory does not
exist, it is created. When used in function view mode (i.e when -name or
-name-regex are used to select specific functions), the report is written to
PATH/functions.EXTENSION. When used in file view mode, a report for each file
is written to PATH/REL_PATH_TO_FILE.EXTENSION.</p>
</dd></dl>

<dl class="std option">
<dt id="cmdoption-llvm-cov-show-Xdemangler">
<span id="cmdoption-llvm-cov-show-xdemangler"></span><code class="sig-name descname">-Xdemangler</code><code class="sig-prename descclassname">=&lt;TOOL&gt;|&lt;TOOL-OPTION&gt;</code><a class="headerlink" href="#cmdoption-llvm-cov-show-Xdemangler" title="Permalink to this definition">¶</a></dt>
<dd><p>Specify a symbol demangler. This can be used to make reports more
human-readable. This option can be specified multiple times to supply
arguments to the demangler (e.g <cite>-Xdemangler c++filt -Xdemangler -n</cite> for C++).
The demangler is expected to read a newline-separated list of symbols from
stdin and write a newline-separated list of the same length to stdout.</p>
</dd></dl>

<dl class="std option">
<dt id="cmdoption-llvm-cov-show-num-threads">
<span id="cmdoption-llvm-cov-show-j"></span><code class="sig-name descname">-num-threads</code><code class="sig-prename descclassname">=N</code><code class="sig-prename descclassname">, </code><code class="sig-name descname">-j</code><code class="sig-prename descclassname">=N</code><a class="headerlink" href="#cmdoption-llvm-cov-show-num-threads" title="Permalink to this definition">¶</a></dt>
<dd><p>Use N threads to write file reports (only applicable when -output-dir is
specified). When N=0, llvm-cov auto-detects an appropriate number of threads to
use. This is the default.</p>
</dd></dl>

<dl class="std option">
<dt id="cmdoption-llvm-cov-show-line-coverage-gt">
<code class="sig-name descname">-line-coverage-gt</code><code class="sig-prename descclassname">=&lt;N&gt;</code><a class="headerlink" href="#cmdoption-llvm-cov-show-line-coverage-gt" title="Permalink to this definition">¶</a></dt>
<dd><p>Show code coverage only for functions with line coverage greater than the
given threshold.</p>
</dd></dl>

<dl class="std option">
<dt id="cmdoption-llvm-cov-show-line-coverage-lt">
<code class="sig-name descname">-line-coverage-lt</code><code class="sig-prename descclassname">=&lt;N&gt;</code><a class="headerlink" href="#cmdoption-llvm-cov-show-line-coverage-lt" title="Permalink to this definition">¶</a></dt>
<dd><p>Show code coverage only for functions with line coverage less than the given
threshold.</p>
</dd></dl>

<dl class="std option">
<dt id="cmdoption-llvm-cov-show-region-coverage-gt">
<code class="sig-name descname">-region-coverage-gt</code><code class="sig-prename descclassname">=&lt;N&gt;</code><a class="headerlink" href="#cmdoption-llvm-cov-show-region-coverage-gt" title="Permalink to this definition">¶</a></dt>
<dd><p>Show code coverage only for functions with region coverage greater than the
given threshold.</p>
</dd></dl>

<dl class="std option">
<dt id="cmdoption-llvm-cov-show-region-coverage-lt">
<code class="sig-name descname">-region-coverage-lt</code><code class="sig-prename descclassname">=&lt;N&gt;</code><a class="headerlink" href="#cmdoption-llvm-cov-show-region-coverage-lt" title="Permalink to this definition">¶</a></dt>
<dd><p>Show code coverage only for functions with region coverage less than the given
threshold.</p>
</dd></dl>

<dl class="std option">
<dt id="cmdoption-llvm-cov-show-path-equivalence">
<code class="sig-name descname">-path-equivalence</code><code class="sig-prename descclassname">=&lt;from&gt;,&lt;to&gt;</code><a class="headerlink" href="#cmdoption-llvm-cov-show-path-equivalence" title="Permalink to this definition">¶</a></dt>
<dd><p>Map the paths in the coverage data to local source file paths. This allows you
to generate the coverage data on one machine, and then use llvm-cov on a
different machine where you have the same files on a different path.</p>
</dd></dl>

</div>
</div>
<div class="section" id="report-command">
<span id="llvm-cov-report"></span><h2>REPORT COMMAND<a class="headerlink" href="#report-command" title="Permalink to this headline">¶</a></h2>
<div class="section" id="id6">
<h3>SYNOPSIS<a class="headerlink" href="#id6" title="Permalink to this headline">¶</a></h3>
<p><strong class="program">llvm-cov report</strong> [<em>options</em>] -instr-profile <em>PROFILE</em> <em>BIN</em> [<em>-object BIN,…</em>] [[<em>-object BIN</em>]] [<em>SOURCES</em>]</p>
</div>
<div class="section" id="id7">
<h3>DESCRIPTION<a class="headerlink" href="#id7" title="Permalink to this headline">¶</a></h3>
<p>The <strong class="program">llvm-cov report</strong> command displays a summary of the coverage of
the binaries <em>BIN</em>,… using the profile data <em>PROFILE</em>. It can optionally be
filtered to only show the coverage for the files listed in <em>SOURCES</em>.</p>
<p><em>BIN</em> may be an executable, object file, dynamic library, or archive (thin or
otherwise).</p>
<p>If no source files are provided, a summary line is printed for each file in the
coverage data. If any files are provided, summaries can be shown for each
function in the listed files if the <code class="docutils literal notranslate"><span class="pre">-show-functions</span></code> option is enabled.</p>
<p>For information on compiling programs for coverage and generating profile data,
see <a class="reference internal" href="#llvm-cov-show"><span class="std std-ref">SHOW COMMAND</span></a>.</p>
</div>
<div class="section" id="id8">
<h3>OPTIONS<a class="headerlink" href="#id8" title="Permalink to this headline">¶</a></h3>
<dl class="std option">
<dt id="cmdoption-llvm-cov-report-use-color">
<code class="sig-name descname">-use-color</code><code class="sig-prename descclassname">[=VALUE]</code><a class="headerlink" href="#cmdoption-llvm-cov-report-use-color" title="Permalink to this definition">¶</a></dt>
<dd><p>Enable or disable color output. By default this is autodetected.</p>
</dd></dl>

<dl class="std option">
<dt id="cmdoption-llvm-cov-report-arch">
<code class="sig-name descname">-arch</code><code class="sig-prename descclassname">=&lt;name&gt;</code><a class="headerlink" href="#cmdoption-llvm-cov-report-arch" title="Permalink to this definition">¶</a></dt>
<dd><p>If the covered binary is a universal binary, select the architecture to use.
It is an error to specify an architecture that is not included in the
universal binary or to use an architecture that does not match a
non-universal binary.</p>
</dd></dl>

<dl class="std option">
<dt id="cmdoption-llvm-cov-report-show-functions">
<code class="sig-name descname">-show-functions</code><code class="sig-prename descclassname"></code><a class="headerlink" href="#cmdoption-llvm-cov-report-show-functions" title="Permalink to this definition">¶</a></dt>
<dd><p>Show coverage summaries for each function. Defaults to false.</p>
</dd></dl>

<dl class="std option">
<dt id="cmdoption-llvm-cov-report-show-instantiation-summary">
<code class="sig-name descname">-show-instantiation-summary</code><code class="sig-prename descclassname"></code><a class="headerlink" href="#cmdoption-llvm-cov-report-show-instantiation-summary" title="Permalink to this definition">¶</a></dt>
<dd><p>Show statistics for all function instantiations. Defaults to false.</p>
</dd></dl>

<dl class="std option">
<dt id="cmdoption-llvm-cov-report-ignore-filename-regex">
<code class="sig-name descname">-ignore-filename-regex</code><code class="sig-prename descclassname">=&lt;PATTERN&gt;</code><a class="headerlink" href="#cmdoption-llvm-cov-report-ignore-filename-regex" title="Permalink to this definition">¶</a></dt>
<dd><p>Skip source code files with file paths that match the given regular expression.</p>
</dd></dl>

</div>
</div>
<div class="section" id="export-command">
<span id="llvm-cov-export"></span><h2>EXPORT COMMAND<a class="headerlink" href="#export-command" title="Permalink to this headline">¶</a></h2>
<div class="section" id="id9">
<h3>SYNOPSIS<a class="headerlink" href="#id9" title="Permalink to this headline">¶</a></h3>
<p><strong class="program">llvm-cov export</strong> [<em>options</em>] -instr-profile <em>PROFILE</em> <em>BIN</em> [<em>-object BIN,…</em>] [[<em>-object BIN</em>]] [<em>SOURCES</em>]</p>
</div>
<div class="section" id="id10">
<h3>DESCRIPTION<a class="headerlink" href="#id10" title="Permalink to this headline">¶</a></h3>
<p>The <strong class="program">llvm-cov export</strong> command exports coverage data of the binaries
<em>BIN</em>,… using the profile data <em>PROFILE</em> in either JSON or lcov trace file
format.</p>
<p>When exporting JSON, the regions, functions, expansions, and summaries of the
coverage data will be exported. When exporting an lcov trace file, the
line-based coverage and summaries will be exported.</p>
<p>The exported data can optionally be filtered to only export the coverage
for the files listed in <em>SOURCES</em>.</p>
<p>For information on compiling programs for coverage and generating profile data,
see <a class="reference internal" href="#llvm-cov-show"><span class="std std-ref">SHOW COMMAND</span></a>.</p>
</div>
<div class="section" id="id11">
<h3>OPTIONS<a class="headerlink" href="#id11" title="Permalink to this headline">¶</a></h3>
<dl class="std option">
<dt id="cmdoption-llvm-cov-export-arch">
<code class="sig-name descname">-arch</code><code class="sig-prename descclassname">=&lt;name&gt;</code><a class="headerlink" href="#cmdoption-llvm-cov-export-arch" title="Permalink to this definition">¶</a></dt>
<dd><p>If the covered binary is a universal binary, select the architecture to use.
It is an error to specify an architecture that is not included in the
universal binary or to use an architecture that does not match a
non-universal binary.</p>
</dd></dl>

<dl class="std option">
<dt id="cmdoption-llvm-cov-export-format">
<code class="sig-name descname">-format</code><code class="sig-prename descclassname">=&lt;FORMAT&gt;</code><a class="headerlink" href="#cmdoption-llvm-cov-export-format" title="Permalink to this definition">¶</a></dt>
<dd><p>Use the specified output format. The supported formats are: “text” (JSON),
“lcov”.</p>
</dd></dl>

<dl class="std option">
<dt id="cmdoption-llvm-cov-export-summary-only">
<code class="sig-name descname">-summary-only</code><code class="sig-prename descclassname"></code><a class="headerlink" href="#cmdoption-llvm-cov-export-summary-only" title="Permalink to this definition">¶</a></dt>
<dd><p>Export only summary information for each file in the coverage data. This mode
will not export coverage information for smaller units such as individual
functions or regions. The result will contain the same information as produced
by the <strong class="program">llvm-cov report</strong> command, but presented in JSON or lcov
format rather than text.</p>
</dd></dl>

<dl class="std option">
<dt id="cmdoption-llvm-cov-export-ignore-filename-regex">
<code class="sig-name descname">-ignore-filename-regex</code><code class="sig-prename descclassname">=&lt;PATTERN&gt;</code><a class="headerlink" href="#cmdoption-llvm-cov-export-ignore-filename-regex" title="Permalink to this definition">¶</a></dt>
<dd><p>Skip source code files with file paths that match the given regular expression.</p>
<dl class="std option">
<dt id="cmdoption-llvm-cov-export-skip-expansions">
<code class="sig-name descname">-skip-expansions</code><code class="sig-prename descclassname"></code><a class="headerlink" href="#cmdoption-llvm-cov-export-skip-expansions" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<p>Skip exporting macro expansion coverage data.</p>
<dl class="std option">
<dt id="cmdoption-llvm-cov-export-skip-functions">
<code class="sig-name descname">-skip-functions</code><code class="sig-prename descclassname"></code><a class="headerlink" href="#cmdoption-llvm-cov-export-skip-functions" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<p>Skip exporting per-function coverage data.</p>
<dl class="std option">
<dt id="cmdoption-llvm-cov-export-num-threads">
<span id="cmdoption-llvm-cov-export-j"></span><code class="sig-name descname">-num-threads</code><code class="sig-prename descclassname">=N</code><code class="sig-prename descclassname">, </code><code class="sig-name descname">-j</code><code class="sig-prename descclassname">=N</code><a class="headerlink" href="#cmdoption-llvm-cov-export-num-threads" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<p>Use N threads to export coverage data. When N=0, llvm-cov auto-detects an
appropriate number of threads to use. This is the default.</p>
</dd></dl>

</div>
</div>
</div>


            <div class="clearer"></div>
          </div>
      </div>
      <div class="clearer"></div>
    </div>
    <div class="related" role="navigation" aria-label="related navigation">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="../genindex.html" title="General Index"
             >index</a></li>
        <li class="right" >
          <a href="llvm-profdata.html" title="llvm-profdata - Profile data tool"
             >next</a> |</li>
        <li class="right" >
          <a href="llvm-diff.html" title="llvm-diff - LLVM structural ‘diff’"
             >previous</a> |</li>
  <li><a href="http://llvm.org/">LLVM Home</a>&nbsp;|&nbsp;</li>
  <li><a href="../index.html">Documentation</a>&raquo;</li>

          <li class="nav-item nav-item-1"><a href="index.html" >LLVM Command Guide</a> &#187;</li>
        <li class="nav-item nav-item-this"><a href="">llvm-cov - emit coverage information</a></li> 
      </ul>
    </div>
    <div class="footer" role="contentinfo">
        &#169; Copyright 2003-2020, LLVM Project.
      Last updated on 2020-09-20.
      Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 3.2.1.
    </div>
  </body>
</html>